package nccloud.mob.riart.message.actions;

import java.util.List;

import nc.vo.ml.NCLangRes4VoTransl;
import nccloud.framework.core.json.IJson;
import nccloud.framework.mob.action.itf.IMobileAction;
import nccloud.framework.mob.container.IMobRequest;
import nccloud.framework.web.json.JsonFactory;
import nccloud.pubitf.platform.attachment.WebFileParaVO;
import nccloud.utils.riart.MessageLogger;

public class MobileFileUploaderAction implements IMobileAction {
	public Object doAction(IMobRequest request) {
		String str = request.read();
		IJson json = JsonFactory.create();
		WebFileParaVO para = (WebFileParaVO) json.fromJson(str, WebFileParaVO.class);
		WebFileParaVO[] returnvo = null;
		String billId = para.getBillId();
		String fullPath = para.getFullPath();
		String folderName = NCLangRes4VoTransl.getNCLangRes().getStrByID("2011nccloud", "02011001-0041");
		List webFileParaVOs;
		try {
//			String returnfileurl = filesTools.Returnfileurl(billId);
		} catch (Exception e) {
			MessageLogger.error("操作此类【nccloud.mob.riart.message.actions.MobileFileUploaderAction】是出现错误，错误描述：【"+e.getMessage()+"】");
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
//		if (fullPath.contains("/")) {
//			if (fullPath.contains("/" + folderName)) {
//				webFileParaVOs = AttchmentQueryUtil.getYhhdByBillid(para.getBillId());
//				if (CollectionUtils.isNotEmpty(webFileParaVOs)) {
//					returnvo = (WebFileParaVO[]) webFileParaVOs.toArray(new WebFileParaVO[0]);
//				} else {
//					returnvo = (WebFileParaVO[]) (new ArrayList()).toArray(new WebFileParaVO[0]);
//				}
//			} else {
//				returnvo = AttchmentQueryUtil.billEnclosureQuery(fullPath, para.getBillId());
//			}
//		} else {
//			webFileParaVOs = AttchmentQueryUtil.getYhhdByBillid(para.getBillId());
//			WebFileParaVO[] webFileParaVO = AttchmentQueryUtil.billEnclosureQuery(fullPath, para.getBillId());
//			WebFileParaVO[] webFileParaVO2 = null;
//			if (CollectionUtils.isNotEmpty(webFileParaVOs)) {
//				webFileParaVO2 = (WebFileParaVO[]) webFileParaVOs.toArray(new WebFileParaVO[0]);
//			} else {
//				webFileParaVO2 = (WebFileParaVO[]) (new ArrayList()).toArray(new WebFileParaVO[0]);
//			}
//
//			returnvo = (WebFileParaVO[]) ((WebFileParaVO[]) ArrayUtils.addAll(webFileParaVO, webFileParaVO2));
//		}

		return returnvo;
	}


}